import * as pako from "pako";

export class PakoEx {

    public static Compress(input: Uint8Array): Uint8Array {
        return pako.deflate(input);
    }

    public static UnCompress(input: Uint8Array): Uint8Array {
        try {
            const result = pako.inflate(input);
            return result;
        } catch (err) {
            console.log("解压发生错误:", err);
        }
        return null;
    }

}